<%
var headContent = {
include("/pages/template/head.html"){}
%>

<script type="text/javascript">
  jQuery(function () {
 // 时间设置
   $('#timepicker1').datetimepicker({
        showSecond : true,
		timeFormat : 'HH:mm:ss',
		stepHour : 1,
		stepMinute : 1,
		stepSecond : 1
            });
	$("#timepicker2").datetimepicker({
		showSecond : true,
		timeFormat : 'HH:mm:ss',
		stepHour : 1,
		stepMinute : 1,
		stepSecond : 1
	});
});
  
    var oper;
    jQuery(function($) {
        // 页面方法
        oper = {
            width : 600,
            height : 600,
            form : document.form1,
            list : function() {
                var url = 'system/dayreport';
                  if(!validForm()) {
		                return;
		            }
                this.form.action = url;
                this.form.submit();
            }
        };
        //显示Menu索引
        showMenu('page_system');
        showMenu('page_dayreport');
    });

    //分页
    var paginator = function(page) {
        oper.list();
    };

</script>

<%
};

var bodyContent = {
%>
<form name="form1" action="" method="post"  class="form-inline" role="form">
	<!-- 菜单 -->
	<% include("/pages/template/menu.html"){} %>

	<div class="tableSearch">
		<%  //查询列表 %>
		<div class="form-group">
			<input id = "timepicker1" class="form-control" type="text" name="attr.startDate" value="${startDate!""}" valid="vtext" validname="开始时间" 
				   placeholder="请输入开始时间" required='required' readonly="true"  />
		</div>
		
		<div class="form-group">
			<input id = "timepicker2" class="form-control" type="text" name="attr.endDate" value="${endDate!""}"  valid="vtext"  validname="结束时间" 
				   placeholder="请输入结束时间" required='required' readonly="true" />
		</div>

		<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			<span class="glyphicon glyphicon-search"></span> 查 询
		</button>
		<button type="button" class="btn btn-default" onclick="resetForm();">
			<span class="glyphicon glyphicon-refresh"></span> 重 置
		</button>
		<button type="button" class="btn btn-default" onclick="oper.add();">
			<span class="glyphicon glyphicon-plus"></span> 新 增
		</button>
	</div>

	<!-- 数据列表 -->
	<table class="table table-striped table-bordered table-hover">
		<thead>
		<tr>
			<%  // 列表头部 %>
			<th style="display:none" name="ids" >ids</th>
			<th name="providerName" >日期</th>
			<th name="productName" >客户</th>
			<th name="productCode" >运营商</th>
			<th name="productPrice" >订单数</th>
			<th name="discount" >成功订单</th>
			<th name="discountPrice" >失败订单</th>
			<th name="discountPrice" >成功率</th>
			<th name="discountPrice" >折扣前交易额</th>
			<th name="productStatus" >折扣后交易额</th>
		</tr>
		</thead>
		<tbody>
			<% 	
				var i = 0;
				for(dayreport in listReport){ 
				i++;
			%>
			<tr>
				<%if(i==1){%>
					<td id='tb_reportdate' rowspan="${listSize}" style="vertical-align: middle;text-align: center;">${dayreport.reportDate!}</td>
				<%}%>
				<%if(dayreport.count !=null){%>
					<td rowspan="${dayreport.count}" style="vertical-align: middle;text-align: center;">${dayreport.customerName!}</td>
				<%}%>
				<td style="vertical-align: middle;text-align: center;">${dayreport.operatorName!}</td>
				<td style="vertical-align: middle;text-align: center;">${dayreport.allCount!}</td>
				<td style="vertical-align: middle;text-align: center;">${dayreport.succeed!}</td>
				<td style="vertical-align: middle;text-align: center;" onclick="showFailedMsg('${dayreport.customerId}','${dayreport.operator}');">${dayreport.failed!}</td>
				<td style="vertical-align: middle;text-align: center;">${dayreport.suRate!}%</td>
				<td style="vertical-align: middle;text-align: center;">${dayreport.tradeAmount2!}</td>
				<td style="vertical-align: middle;text-align: center;">${dayreport.tradeAmount!}</td>
			</tr>
			<% } %>
		</tbody>
	</table>
</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>